﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="SettingGallery.aspx.cs" Inherits="TamTreSoSinh.Admin.SettingGallery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form id="Form1" runat="server">
    <b>Gallery</b><br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCreated="GridView1_RowCreated">
        <Columns>
            <asp:BoundField DataField="Priority" HeaderText="Thứ tự" />
            <asp:TemplateField HeaderText="Ảnh">
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="hplImage" NavigateUrl='<%# Eval("Id", "/Admin/SettingGalleryDetail.aspx?Id={0}") %>'>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImagePath") %>' Style="max-width: 180px;
                            margin: 5px" />
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblName"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:BoundField DataField="IsOnHomePage" HeaderText="Hiển thị lên trang chủ" />
            <asp:TemplateField HeaderText="Xóa">
                <ItemTemplate>
                    <asp:HiddenField runat="server" ID="hidId" />
                    <asp:CheckBox runat="server" ID="chkDelete" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <br />
    <asp:Button ID="btnAddNew" runat="server" Text="Add new" OnClick="btnAddNew_Click" />
    &nbsp;<asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" OnClientClick="return confirmDelete()"
        Text="Delete" />
    </form>
    <script type="text/javascript">
        function confirmDelete() {
            return confirm("Bạn có muốn xóa ảnh này?");
        }
    </script>
</asp:Content>
